package yy.com.yjboview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import butterknife.ButterKnife;
import butterknife.OnClick;
import yy.com.yjboview.util.CommonUtil;
import yy.com.yjboview.util.ShowTipDialog;
import yy.com.yjboview.viewutil.SimpleViewUtil2;

/***
 * 学习canvas 参考：http://www.idtkm.com/customview/customview2/
 * 2016年8月3日14:19:15
 *
 * @author yjbo
 */
public class CanvasActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_canvas);
        ButterKnife.bind(this);
    }

    @Override
    protected void onStart() {
        super.onStart();
        ShowTipDialog.SetonDialog(new ShowTipDialog.DialogChoose() {
            @Override
            public void query(int position) {
                Toast.makeText(CanvasActivity.this, "您点击了" + position, Toast.LENGTH_SHORT).show();
                new SimpleViewUtil2(getApplicationContext(), position);
            }
        });
    }

    @OnClick({R.id.choose_txt, R.id.simple_view})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.choose_txt:
                ShowTipDialog.layDialog(CanvasActivity.this, "选择canvas类型", CommonUtil.names, "点击了哪一条", "", "", true);
                break;
            case R.id.simple_view:

                break;
        }
    }
}
